Skip to content

Fix #5455: Fix computation of companion object of opaque type #5480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 21, 2018

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 20, 2018

No description provided.

@odersky
Copy link
Contributor Author

odersky commented Nov 20, 2018

I was wondering why this passed the tests before. It turns out that by accident we always had an operand of type T.T in scope where T is the opaque type. For T.T we had the object T
as part of the type, so we looked for implicits inside.

i5455.scala showed another misuse: One could get at the local copy
of an opaque type even though this type was not defined. This commit
closes that loophole.

Aside: It might be better to do the opaque type expansion in Namer
instead of in Desugar. This could let us use a synthetic name for
the local alias and thereby avoid namespace pollution. Right now one cannot
define a type with the same name as the opaque type alias in the
latter's companion object. It's a crazy thing to do, but still...
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liufengyun liufengyun merged commit 5648ca7 into scala:master Nov 21, 2018
@liufengyun liufengyun deleted the fix-#5455 branch November 21, 2018 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants